import request from '@/utils/request'

// 查询销售订单列表
function list(query) {
  return request({
    url: '/business/sale/list',
    method: 'get',
    params: query
  })
}

// 保存销售订单
function save(data) {
  return request({
    url: '/business/sale/save',
    method: 'post',
    data: data
  })
}

// 删除销售订单
export function del(id) {
  return request({
    url: '/business/sale/delete/' + id,
    method: 'delete'
  })
}

//批量删除销售订单
function batchDel(data) {
  return request({
    url: '/business/sale/batchDel',
    method: 'delete',
    data: data
  })
}

// 根据id获取销售订单详细信息
function findById(id) {
  return request({
    url: '/business/sale/findById/' + id,
    method: 'get'
  })
}

export const sale = {
  list,
  save,
  del,
  batchDel,
  findById
};
